package com.ldw.controller;


import com.ldw.service.TagService;
import com.ldw.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("tags")
public class TagsController {

    @Autowired
    private TagService tagService;

    @GetMapping
    public Result tag() {
        return tags();
    }

    @GetMapping("/detail")
    public Result tags() {
        return tagService.tags();
    }

    @GetMapping("/detail/{id}")
    public Result tagById(@PathVariable("id") Long id) {
        return tagService.tagById(id);
    }
}
